﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TV_practice
{
    class TV
    {
        public int CurrentChannel { get; private set; }
        private List<Channel> channelList = new List<Channel>();

        public void SwithChannelUp()
        {
            CurrentChannel++;
            if (CurrentChannel == channelList.Count)
                CurrentChannel = 0;
           
        }

        public void SwitchChannelDown()
        {
            if (CurrentChannel == 0)
                CurrentChannel = channelList.Count;
            CurrentChannel--;
        }

        public void ShowCurrentChannel()
        {
            Console.WriteLine("Current channel Number and Name: {0} - {1}", channelList[CurrentChannel].ChannelNumber, channelList[CurrentChannel].ChannelName);
            Console.ReadKey();
        }

        public void ChannelListGenerator()
        {
            for (int i =0;i<5;i++)
            {
                Channel newChannel = new Channel(i + 1, "UnicChannelName_" + (i+1));
                channelList.Add(newChannel);
            }
        }
    }
}
